package com.mtw.bbs.bbsUser.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.mtw.bbs.common.jdbcBase.entity.BaseEntity;
import com.mtw.bbs.userAdmin.pojo.vo.ResourceVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 资源
 *
 * @author mo
 * @email mo
 * @date 2023-10-18 15:44:13
 */
@Data
@TableName("os_resource")
@ApiModel("资源接口")
public class ResourceAPI extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@TableId
	@ApiModelProperty(value = "主键")
	private String id;


	@ApiModelProperty(value = "资源名称")
	private String name;


	@ApiModelProperty(value = "资源编码")
	private String code;


	@ApiModelProperty(value = "资源类型")
	private Integer type;


	@ApiModelProperty(value = "资源路径")
	private String url;


	@ApiModelProperty(value = "资源方法")
	private String method;


	@ApiModelProperty(value = "资源描述")
	private String description;

	public ResourceAPI(){

	}

	public ResourceVo toVo(){
		ResourceVo vo = new ResourceVo();
		vo.setId(this.getId());
		vo.setName(this.getName());
		vo.setCode(this.getCode());
		vo.setType(this.getType());
		vo.setUrl(this.getUrl());
		vo.setMethod(this.getMethod());
		vo.setDescription(this.getDescription());
		vo.setStatus(this.getStatus());
		return vo;
	}

}
